// EventHooks.cpp : event handler call back function
//


#include "stdafx.h"

#include "EventHooks.h"

#pragma warning(disable : 4100)


HWND g_hFocusWindow = NULL;


extern "C"
{

//// EventHandlerIOComplete
//
// Simple event handler callback routine.
//
ViStatus _VI_FUNCH
EventHandlerIOComplete(
	ViSession vi,
	ViEventType eventType,
	ViEvent context,
	ViAddr userHandle
)
{
	if (eventType == VI_EVENT_IO_COMPLETION)
	{
		::OutputDebugString(_T("EventHandlerIOComplete() - invoked with eventType == VI_EVENT_IO_COMPLETION\n"));
		::MessageBox(g_hFocusWindow, 
					 _T("EventHandlerIOComplete() invoked with eventType == VI_EVENT_IO_COMPLETION"),
					 _T("Visa API Demo - EventHandlerIOComplete()"),
					 MB_OK | MB_ICONINFORMATION);
	}
	else
	{
		::OutputDebugString(_T("EventHandlerIOComplete() - invoked for unexpected eventType\n"));
		::MessageBox(g_hFocusWindow, 
					 _T("EventHandlerIOComplete() - invoked for unexpected eventType"),
					 _T("Visa API Demo - EventHandlerIOComplete()"),
					 MB_OK | MB_ICONINFORMATION);
	}

	return VI_SUCCESS;
}


}	// extern "C"
